﻿@model LogOnModel

<div class="container-fluid" style="width:80%;margin: 0 auto;" >
 <form id="loginform" method="post" >
    <div class="control-group">
      <label class="control-label" for="input01">用户名：</label>
      <div class="controls">
        @Html.TextBoxFor(m => m.UserName, new { @class="input-xlarge"})
        <p class="help-block">@Html.ValidationMessageFor(m=>m.UserName)</p>
      </div>
    </div>
    <div class="control-group">
      <label class="control-label" for="input01">密码：</label>
      <div class="controls">
        @Html.PasswordFor(m=>m.Password, new { @class="input-xlarge"})
        <p class="help-block">@Html.ValidationMessageFor(m=>m.Password)</p>
      </div>
    </div>
    <div class="control-group">
      <div class="controls">
        @Html.CheckBoxFor(m=>m.RememberMe) <span> 保存状态</span>
        <p class="help-block"></p>
      </div>
    </div>
     <div style="background-color:white;border-top: 0px solid" class="form-actions">
            <button style="float:right;" type="submit" class="btn btn-primary">登录</button>
         @ViewBag.msg
      </div>
     </form>
</div>
 @Scripts.Render("~/js/jqueryval")
<script type="text/javascript">
    $(function(){
        $("#loginform").submit(function(){
            if ($(this).valid()) {
                $.post("/login/DojsLogin", $(this).serialize(), function (data) {
                    if (data.Uid > 0)
                    {
                        location.reload();
                    }
                });
            }
            return false;
        });
    });
</script>